﻿using System;
using System.Text.RegularExpressions;

namespace RealNumberValidator
{
    public class Program
    {
        public static void Main()
        {
            string[] numbers = 
            {
                "0", "33", "-2381.78132", "4.3347", "12.00", "0.34",
                "+3", "24 543", "01.23", "12.", "11,23", "--2", ".25", "-.25", "12е7", "+0", "-0"
            };
            string pattern = @"\A(0|(-?[1-9]\d*)|(-?(0|[1-9]\d*)\.\d+))\Z";

            Regex regex = new Regex(pattern);
            foreach (String number in numbers)
            {
                Match match = regex.Match(number);
                if (match.Success)
                {
                    Console.Write("{0} ", match.Value);
                }
            }
            Console.WriteLine();
        }
    }
}
